<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery的get请求的ajax</title>
    <script src="js/jquery-3.3.1.js"></script>
    <script>
        // $.ajax({
        //     type: "POST",
        //     url: "some.php",
        //     data: "name=John&location=Boston",
        //     success: function(msg){
        //         alert( "Data Saved: " + msg );
        //     }
        // });
        function getJqAjax() {

            $.ajax(
                {
                    url:"/servletDemo",
                    type:"GET",
                    data:"username=marong&password=jinlian",
                    success:function (msg) {

                        alert(msg);
                    },

                    error:function (msg) {

                        alert(msg);
                    }


                }

            );

        }
    </script>
</head>
<body>
    用户名：<input type="text" name="username" value="jack"><br>
    密码：<input type="password" name="password" value="123456"><br>
    <input type="button" value="jq的get请求" onclick="getJqAjax()">
</body>
</html>